home *** CD-ROM | disk | FTP | other *** search
/ New Star Software Collection / NSS_Collection.iso / 3-170 dbase 10 for windows / 1.ima / DOC.PAK / STRMOUT.TXT < prev    next >
Encoding:
Text File  |  1993-07-26  |  11.7 KB  |  385 lines

  1.      Copyright (c) 1991-1993 Borland International, Inc.
  2.                     All Rights Reserved.
  3.  
  4.              STREAMING OUTPUT IN BLADERUNNER
  5.              -------------------------------
  6.  
  7. This paper describes Bladerunner's streaming output commands
  8. and functions. It includes the ?, ?? and related commands;
  9. console, file and printer output devices; and configuration
  10. parameters.
  11.  
  12. Bladerunner extends the dBASE IV stream printing mechanisms
  13. to allow access to Windows fonts and printers.  Also,
  14. the mechanism allows for finer coordinate control.
  15.  
  16. While this paper introduces printing concepts, it does not
  17. cover the File | Print menu command, or printing of GUI
  18. windows and objects.
  19.  
  20. Contents
  21. --------
  22. I.   Commands and Functions
  23.        Proportional Fonts
  24.        ANSI and OEM Fonts
  25. II.  Printer System Memory Variables
  26. III. Configuration User Interface
  27.  
  28. Commands and Functions
  29. ----------------------
  30.  
  31. This section summarizes each command's or function's new
  32. behavior in Bladerunner.
  33.  
  34. ?, ?? command
  35.  
  36. Syntax:
  37.  
  38.      ??
  39.       [<exp 1>
  40.        [PICTURE <clause 1>]
  41.        [FUNCTION <clause 2>]
  42.        [AT <numExp>]]
  43.        [STYLE <[<font number exp>]
  44.         [<style option(s) exp>]]
  45.       [,<exp 2>...[,...]]
  46.  
  47. STYLE <exp> option
  48.  
  49. The STYLE option is the same as the one in dBASE IV.  The
  50. expression can be one of the following forms:
  51.  
  52.      ? STYLE 1
  53.      ? STYLE "B"
  54.      ? STYLE "2U"
  55.  
  56. The letter in the parameter specifies one of the following
  57. character attributes:
  58.  
  59.      B - Bold
  60.      I - Italic
  61.      U - Underlined
  62.      R - Raised (Superscript)
  63.      L - Lowered (Subscript)
  64.  
  65. The font number in the STYLE expression specifies the
  66. typeface to be used.  The number refers to an entry in the
  67. [Fonts] section of the DBASEWIN.INI file that declares the
  68. font number and face. The [Fonts] section looks like this:
  69.  
  70.      [Fonts]
  71.      1=Times New Roman,12,ROMAN
  72.      2=Arial,10,SWISS
  73.  
  74. The number is the font number that will be used in the STYLE
  75. command.  Next is the font face name (from the Windows font
  76. selection dialog), followed by the point size and the font
  77. family.  Any number from 1 to 32766 is a legal style number.
  78.  
  79. A font can be in one of the following families: ROMAN,
  80. SWISS, MODERN, SCRIPT, or DECORATIVE.  In the event the font
  81. named is not available on some output device, Windows
  82. chooses a font from the same family.
  83.  
  84. Proportional Fonts
  85.  
  86. Specifying a variable-pitch font subtly changes the meaning
  87. of some of the command's parameters.  These are listed
  88. below.  In general, though, where dBASE IV uses a number to
  89. specify a position or size in character units, the user may
  90. now specify fractional character values (that is, values
  91. with a decimal point, like 11.53).  Existing code, which
  92. does not specify fractional units and does not use variable-
  93. pitch fonts, behaves exactly as before.
  94.  
  95. When the user does not specify a style, a fixed-pitch font
  96. (usually Courier) will be selected.  The _PPITCH memvar
  97. specifies the pitch (width) of the font.
  98.  
  99. Fonts may vary in height as well.  You can, for example,
  100. print a 10 point font and a 12 point font on the same line.
  101. In such cases, the height of the line is determined by the
  102. tallest font on the line.
  103.  
  104. ANSI and OEM Fonts
  105.  
  106. A font style can specify an ANSI or an OEM font.  If Blade
  107. Runner's internal character set matches the font being used
  108. to display information, no translation is done.  If the
  109. internal character set does not match the font's character
  110. set, the data is translated before being printed.  This may
  111. cause certain graphics characters to print incorrectly.
  112.  
  113. FUNCTION <expC> option
  114.  
  115. The V option of the FUNCTION parameter accepts fractional
  116. units. For example, the user may now specify code like the
  117. following, to wrap the string in a column 15 1/2 characters
  118. wide.
  119.  
  120. ? "This is a very long string that will wrap within the;
  121. column."  FUNCTION "V15.5" STYLE 1
  122.  
  123. This will print a string like the following:
  124.  
  125.      This is a very
  126.      long string that
  127.      will wrap within
  128.      the column.
  129.  
  130. The J and I (alignment) options will align printed output of
  131. variable-pitch strings.  For example, the following code
  132. produces the centered output below.
  133.  
  134. ? "This is a very long string that will wrap within the;
  135. column." FUNCTION "V15.5I" STYLE 1
  136.  
  137.                          This is a very
  138.                         long string that
  139.                         will wrap within
  140.                            the column.
  141.  
  142. AT <expN> option
  143.  
  144. This option accepts a fractional number for the column
  145. position. For example:
  146.  
  147. ? "This is a very long string that will wrap within the;
  148. column." FUNCTION "V15.5" STYLE 1 AT 15.5
  149.  
  150. Displays the line indented :
  151.  
  152.      This is a very
  153.      long string that
  154.      will wrap within
  155.      the column.
  156.  
  157. ??? command
  158.  
  159. Use of the ??? command in Bladerunner is not recommended.
  160. Direct printer control codes may not be supported by the
  161. Windows printer driver, and may cause output to behave
  162. unexpectedly.  The ??? command was originally introduced to
  163. allow a user to produce graphical effects, like proportional
  164. fonts, that are already supported in Bladerunner. Therefore,
  165. it should not be necessary to use it.
  166.  
  167. SET PRINTER TO command
  168.  
  169. Syntax:
  170.  
  171.      SET PRINTER TO
  172.       [<[FILE] <<filename> |?>> |
  173.           <device 1> |
  174.           \\CAPTURE |
  175.        \\<computer name>\<printer name>=<device 2> |
  176.           \\SPOOLER]
  177.  
  178. The SET PRINTER TO command closes the current print document
  179. and begins a new print document on the specified device.  If
  180. the device is a printer, Windows usually spools the output
  181. until the document is finished.  If the device is a file,
  182. the resulting file can be copied to the printer port for
  183. printing.  Because this output file contains binary codes,
  184. it is probably not human-readable.
  185.  
  186. In Windows, printing is document-oriented.  You open a
  187. printer document, output the pages you want to print, then
  188. close the document.  In Bladerunner, you must issue a SET
  189. PRINTER TO <port> or SET PRINTER ON to open the document
  190. before you output text. To print the document, you close it
  191. by using the CLOSE PRINTER command, or SET PRINTER TO, which
  192. also resets the output device.
  193.  
  194. When you output text for printing, the text is converted
  195. into print codes by the Windows printer driver, and fed to
  196. the Print Manager.  The Print Manager then copies the print
  197. codes to the printer through the output port.  The Print
  198. Manager handles normal printer problems (such as Out Of
  199. Paper), making it unnecessary for the dBASE programmer to
  200. handle these conditions.
  201.  
  202. SET DEVICE TO command
  203.  
  204. Syntax
  205.  
  206.      SET DEVICE TO SCREEN | PRINTER | FILE <filename|?>
  207.  
  208. This command redirects @..SAY commands to the specified
  209. device. It can be used to print forms on paper.
  210.  
  211. ON PAGE command
  212.  
  213. Syntax:
  214.  
  215.      ON PAGE [AT LINE <expN>] <command block>
  216.  
  217. This command can receive a fractional line number.  The ON
  218. PAGE command block will be triggered when the current
  219. printing line is below or overlaps with the vertical
  220. coordinate specified in the AT LINE command.
  221.  
  222. PRINTJOB/ENDPRINTJOB block
  223.  
  224. This command closes the current print document and begins a
  225. new one, as if the user issued the CLOSE PRINTER command
  226. before the PRINTJOB block begins.  When the ENDPRINTJOB
  227. block has finished executing, the print document is closed
  228. and printed, and a new one is begun.
  229.  
  230. CHOOSEPRINTER() function
  231.  
  232. Syntax:
  233.  
  234.      CHOOSEPRINTER( [<title: expC>] )
  235.  
  236. This function displays the normal Windows Printer Setup
  237. dialog box.  The user then may select a printer or change
  238. the printer settings.  If the user presses the OK button to
  239. accept the changes, the function returns TRUE, and the value
  240. of the following settings and system memvars are changed:
  241.  
  242.      SET PRINTER TO
  243.      _PDRIVER
  244.      _PLENGTH
  245.      _PORIENTATION
  246.      _PCOPIES
  247.      _PBPAGE
  248.      _PEPAGE
  249.      _PQUALITY
  250.  
  251. If the user presses CANCEL, the function returns FALSE and
  252. nothing is changed.
  253.  
  254. PRINTSTATUS() function
  255.  
  256. Syntax
  257.  
  258.      PRINTSTATUS([<expC>])
  259.  
  260. This function returns TRUE if the current printer is
  261. operating. Use <expC> to specify a different port to check
  262. Because printer output in Windows is buffered by the Print
  263. Manager, the PRINTSTATUS() function usually only returns
  264. FALSE if there is not enough disk space or memory to spool
  265. the output file.  Other errors, such as out of paper, are
  266. handled directly by the Print Manager.
  267.  
  268. If the printer port is not the port specified with SET
  269. PRINTER TO port, PRINTSTATUS() returns FALSE.
  270.  
  271. PCOL() and PROW() functions
  272.  
  273. These functions can return fractional values for the printer
  274. head location.
  275.  
  276. DEFINE BOX
  277.  
  278. This command is supported for compatibility, but is not as
  279. useful as the graphical printing commands.
  280.  
  281. Printer System Memory Variables
  282. -------------------------------
  283.  
  284. The following system memvars behave differently in
  285. Bladerunner:
  286.  
  287. _BOX
  288.  
  289. This memvar is still supported for compatibility, but is not
  290. as useful as the drawing commands.
  291.  
  292. _PDRIVER
  293.  
  294. The _PDRIVER variable can be assigned a string like the
  295. following:
  296.  
  297.      _PDRIVER = "HPPCL, PCL / HP LaserJet II"
  298.  
  299. The string has two comma-separated parts.  The first part is
  300. the file name of the print driver; the second part specifies
  301. the name of the printer.  Because a Windows printer driver
  302. may support more than one printer type, the user must
  303. provide the printer type in the _PDRIVER setting.  dBASE IV
  304. values are not permitted.
  305.  
  306. _PCOLNO, __PLINENO, __PLOFFSET, __PLENGTH, __PLINENO, _TABS,
  307.  
  308. These memvars can have fractional values.
  309.  
  310. _PSPACING
  311.  
  312. This memvar can have a fractional value.  In Bladerunner,
  313. the paragraph spacing is in multiples of the height of the
  314. line just printed, which depends on the font(s) used to
  315. print the line.
  316.  
  317. _PPITCH
  318.  
  319. This memvar determines the size of the default output font.
  320. It also determines the size of a horizontal coordinate.  For
  321. example,
  322.  
  323.      _ppitch = "PICA"
  324.      ? "Hi there" AT 10
  325.  
  326. prints the string one inch from the left margin.  However,
  327. the following code
  328.  
  329.      _ppitch = "ELITE"
  330.      ? "Hi there" AT 10
  331.  
  332. prints the string 10/12 of an inch from the left margin.
  333. Line height is not affected by the pitch of the font.
  334.  
  335. _PSCODE, _PECODE
  336.  
  337. Use of these memvars is not recommended for the same reason
  338. as the ??? command.
  339.  
  340. _PFORM
  341.  
  342. dBASE IV .PRF files will still work, but the driver name
  343. will be ignored.  The SAVE PFORM TO command in Bladerunner
  344. will save the file in a different format.
  345.  
  346. _PORIENTATION
  347.  
  348. Syntax:
  349.  
  350.      _PORIENTATION = "PORTRAIT" | "LANDSCAPE"
  351.  
  352. This is a new memvar that controls the orientation of the
  353. paper in the printer.  The change takes effect when the next
  354. print document is started, usually in the SET PRINTER TO
  355. command.
  356.  
  357. _WRAP, _ALIGNMENT, _INDENT, _LMARGIN, _RMARGIN
  358.  
  359. These memvars operate when _WRAP is TRUE.  Bladerunner
  360. correctly does word wrapping even when printing with
  361. proportional fonts.
  362.  
  363. When printing to several devices, each device may have
  364. different word wrapping rules.  For example, the console and
  365. alternate file outputs are character-oriented devices, but
  366. the printer is a pixel-oriented device.  With a proportional
  367. font, a different number of characters may fit on one line.
  368. In this case, the printer is considered the driving device,
  369. and the same number of characters will be output to the
  370. screen as the printer.  Output to the screen may appear
  371. ragged, but the same text appears on the same line in both
  372. devices.
  373.  
  374. Mixing _WRAP output with FUNCTION "V" or memo-field output
  375. can cause different results than in dBASE IV.
  376.  
  377. Configuration User Interface
  378. ----------------------------
  379.  
  380. The .INI settings can be changed by using the Properties |
  381. Printer Fonts dialog box.  The dialog box allows the user to
  382. enter a font number, and then choose a typeface to be
  383. associated with the font number.  This information is stored
  384. in the DBASEWIN.INI [Fonts] section.
  385.